package wpp.cfg;

import java.util.UUID;

public class WPFileBean implements Comparable<WPFileBean>{
	
	private String orgUniqueName;
	private String fileName;
	private String title;
	private Integer x;
	private Integer y;
	private Long createTimeStamp;
	private Integer favore;
	private String[] category;
	private String wpURLPath;	

	public static String newFileName() {
		return UUID.randomUUID().toString().replaceAll("-", "") + ".jpg";
	}
	
	public Integer favor() {
		return ++ favore;
	}
	
	//Getters and Setters
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}	
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public Integer getX() {
		return x;
	}
	public void setX(Integer x) {
		this.x = x;
	}
	public Integer getY() {
		return y;
	}
	public void setY(Integer y) {
		this.y = y;
	}	
	public Long getCreateTimeStamp() {
		return createTimeStamp;
	}
	public void setCreateTimeStamp(Long createTimeStamp) {
		this.createTimeStamp = createTimeStamp;
	}		
	public Integer getFavore() {
		return favore;
	}
	public void setFavore(Integer favore) {
		this.favore = favore;
	}
	public String[] getCategory() {
		return category;
	}
	public void setCategory(String[] category) {
		this.category = category;
	}
	public String getWpURLPath() {
		return wpURLPath;
	}
	public void setWpURLPath(String wpURLPath) {
		this.wpURLPath = wpURLPath;
	}
	public String getOrgUniqueName() {
		return orgUniqueName;
	}
	public void setOrgUniqueName(String orgUniqueName) {
		this.orgUniqueName = orgUniqueName;
	}

	@Override
	public int compareTo(WPFileBean o) {
		if(o == null || o.getCreateTimeStamp() == null) {
			return 1;
		}
		return (int) (this.createTimeStamp - o.getCreateTimeStamp());
	}
}
